package com.yx.frame.web;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public final class AsyncServiceExecutor {
	private static  ExecutorService executor = null;
	public static void init(int maxAsyncThreadPoolSize){
		if(executor==null&&maxAsyncThreadPoolSize>0){
			executor = Executors.newFixedThreadPool(maxAsyncThreadPoolSize);  
		}
	}
	public static boolean isAllright(){
		if(executor==null)return false;
		return true;
	}
	public static void execute(Runnable runnable){
		executor.execute(runnable);
	}
}
